package com.bingo.demo.pojo;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;

public class Essay {
    Integer id;
    String number;//文章号
    String title;//文章标题
    String tag;//文章标签
    String content;//文章内容
    String code;//代码
    String imgUrl;//文章图片url
    Timestamp publishTime;//发布时间
    Integer userId;//作者id
    String userName;//用户昵称
    Integer authority;//权限设置,0代表仅自己可见,1代表公开,2代表需要vip
    Integer readerNum;//阅读量

    @Override
    public String toString() {
        return "Essay{" +
                "id=" + id +
                ", number='" + number + '\'' +
                ", title='" + title + '\'' +
                ", tag='" + tag + '\'' +
                ", content='" + content + '\'' +
                ", imgUrl='" + imgUrl + '\'' +
                ", publishTime=" + publishTime +
                ", userId=" + userId +
                ", authority=" + authority +
                ", readerNum=" + readerNum +
                '}';
    }

    public Essay() {
    }

    public Essay(Integer id, String number, String title, String tag, String content, String code, String imgUrl, Timestamp publishTime, Integer userId, String userName, Integer authority, Integer readerNum) {
        this.id = id;
        this.number = number;
        this.title = title;
        this.tag = tag;
        this.content = content;
        this.code = code;
        this.imgUrl = imgUrl;
        this.publishTime = publishTime;
        this.userId = userId;
        this.userName = userName;
        this.authority = authority;
        this.readerNum = readerNum;
    }

    public String getPublishTime() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String format = sdf.format(publishTime);
        return format;
    }

    public void setPublishTime(Timestamp publishTime) {
        this.publishTime = publishTime;
    }

    public Integer getReaderNum() {
        return readerNum;
    }

    public void setReaderNum(Integer readerNum) {
        this.readerNum = readerNum;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getAuthority() {
        return authority;
    }

    public void setAuthority(Integer authority) {
        this.authority = authority;
    }
}
